#include "SqList.h"

bool insert(Sqlist& L, int pos, elemtype e)
{
    if (L._size >= L._capacity)  return false;
    for (int i = L._size - 1; i >= pos - 1; i--)
    {
        L.elem[i + 1] = L.elem[i];
    }
    L.elem[pos - 1] = e;
    L._size++;
    return true;
}
bool push_back(Sqlist& L, elemtype e)
{
    if (L._size >= L._capacity)  return false;
    L.elem[L._size++] = e;
    return true;
}
bool del(Sqlist& L,int pos)
{
    if (pos == L._size - 1)
    {
        L._size--;
        return true;
    }
    for (int i = pos-1; i < L._size - 1; i++)
    {
        L.elem[i] = L.elem[i + 1];
    }
    L._size--;
    return true;
}

void print(Sqlist& L)
{
    for (int i = 0; i < L._size; i++)
        std::cout << L.elem[i] << ' ';
    std::cout << std::endl;
}



